package com.wing.product.controller;

import com.alibaba.druid.util.StringUtils;
import com.wing.common.utils.JsonResult;
import com.wing.product.service.WarehouseMaterialRequisitionRecordDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "领料明细管理", tags = "#/warehouse/product/warehouseMaterialRequisitionRecordDetail")
@RestController("WarehouseMaterialRequisitionRecordDetailController")
@RequestMapping("/warehouse/materialRequisitionRecordDetail")
@RequiredArgsConstructor
public class WarehouseMaterialRequisitionRecordDetailController {

    private final WarehouseMaterialRequisitionRecordDetailService warehouseMaterialRequisitionRecordDetailService;

    @ApiOperation(value = "修改上机状态", notes = "修改")
    @GetMapping("/updateComputerPractice")
    public JsonResult updateComputerPractice(@RequestParam String id, @RequestParam String status){
        if (!StringUtils.isEmpty(id)){
            return warehouseMaterialRequisitionRecordDetailService.updateComputerPractice(id,status);
        }else {
            return  JsonResult.fail("id为空");
        }
    }
}
